package com.github.shiqiyue.app.common.gson;

import com.github.shiqiyue.app.common.enums.IBaseEnum;
import com.google.gson.JsonElement;
import com.google.gson.JsonPrimitive;
import com.google.gson.JsonSerializationContext;
import com.google.gson.JsonSerializer;

import java.lang.reflect.Type;

public class IBaseEnumJsonSerializer implements JsonSerializer<IBaseEnum> {


    @Override
    public JsonElement serialize(IBaseEnum iBaseEnum, Type type, JsonSerializationContext jsonSerializationContext) {
        return new JsonPrimitive(iBaseEnum.getValue());
    }
}
